package main

import "time"

func main() {
	// TODO 应该加上剩余药数
	println("在用药品名字\t剩余天数\t用尽日期")
	// 雷贝
	var leiBei = 14 + 14 + 5 + 7 + 2 + 4 + 4 + 7*2*4 + 7*2*4 + 7*2*4
	leiBeiDay := leiBei / 2
	finishDay("雷贝拉唑钠肠", leiBeiDay)

	// 吲哚布芬
	var yinDuoBuFen = 7 + 4 + 1 + 5 + 70 + 7*5
	yinDuoBuFenDay := yinDuoBuFen / 1
	finishDay("吲哚布芬", yinDuoBuFenDay)

	// 瑞舒伐他汀
	var ruiShuFaTaTing = 48 + 28 + 7 + 48
	ruiShuFaTaTingDay := ruiShuFaTaTing / 1
	finishDay("瑞舒伐他汀", ruiShuFaTaTingDay)

	// 酸美托洛尔
	var suiMeiTuoLuoEr = 5 + 3 + 14 + 12 + 3 + 28
	suiMeiTuoLuoErDay := float64(suiMeiTuoLuoEr) / 0.5
	finishDay("酸美托洛尔", int(suiMeiTuoLuoErDay))

	// 阿利沙坦
	var aLiShaTan = 2 + 7 + 28
	aLiShaTanDay := float64(aLiShaTan) / 0.25
	finishDay("阿利沙坦", int(aLiShaTanDay))

	// 硫酸氢氯吡格
	var liuSuanQingLvPiGe = 14 + 14 + 9 + 4 + 90
	finishDay("硫酸氢氯吡格", liuSuanQingLvPiGe)

	// 螺内脂片
	var luoNeiZhiPian = 30 + 100
	finishDay("螺内脂片", luoNeiZhiPian)

	// 呋塞米片
	var fuSaiMiPian = 30 + 100
	finishDay("呋塞米片", fuSaiMiPian)

}

func finishDay(medicineName string, day int) {
	// 当前日期 -指定日志 = 已用天数
	// 剩余天数 = day - 已用天数
	date := time.Date(2023, 2, 5, 0, 0, 0, 0, time.Local)
	finish := date.Add(time.Duration(day*24) * time.Hour)
	println(medicineName, "\t", day, "\t=>\t", finish.Format("2006-01-02"))
}
